import http from "@/api";
import { joinQueryParams } from "@/utils/qs";

// 分页查询借出申请的Api
export const selectDevLendByPageApi = data => {
  return http.post("/devLend/selectByPage" + joinQueryParams(data), null, { loading: false });
};

// 仪器借出申请的Api
export const devLendApplyApi = (data: {
  studentCode: string;
  studentName: string;
  studentPhone: string;
  lendDev: string;
  lendCount: string | number;
  estimateReturnTime: string;
  estimateLendTime: string;
  teacherName: string;
  devLendDesc: string;
}) => {
  return http.post("/devLend/apply" + joinQueryParams(data), null, { loading: false });
};

// 审核借出申请的Api
export const devLendCheckApi = (data: { devLendId: number | string | null; checkDesc: string; status: string | number }) => {
  return http.post("/devLend/check" + joinQueryParams(data), null, { loading: false });
};

// 分页查询借出申请的Api
export const devLendReturnApi = (data: { devLendId: number | string | null }) => {
  return http.post("/devLend/return" + joinQueryParams(data), null, { loading: false });
};
